package com.richfit.cuba.web.config.quartz.config;


/**
 * @Description: :
 * @date :Create in  2018/2/24- 14:09
 * @Version: V1.0
 * @Modified By:
 **/
public enum  ConfigEnum {
    STATUS_START("1","quartz.configEnum.enable"),
    STATUS_STOP("0","quartz.configEnum.disable");
    private String code;
    private String message;

    ConfigEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String findToMessage(String code){
        for (ConfigEnum configEnum : ConfigEnum.values()) {
            if (configEnum.code.equals(code)){
                return configEnum.getMessage();
            }
        }
        return null;
    }
    
    public static String findToCode(String message){
        for (ConfigEnum configEnum : ConfigEnum.values()) {
            if (configEnum.getMessage().equals(message)){
                return configEnum.getCode();
            }
        }
        return null;
    }
}
